<template>
  <a-modal :open="open" width="1000px" title="费用查询" centered @cancel="onCancel" @ok="onOk">
    <div class="flex mt-4">
      <LabelValue label-class="text-right font-bold ml-2" value-class="font-bold" label="床位号" value="item.zyh" />
      <LabelValue label-class="text-right w-20 font-bold" value-class="font-bold" label="姓名" value="item.bqmc" />
      <LabelValue label-class="text-right w-20 font-bold" value-class="font-bold" label="性别" value="item.zyzdmc" :width="220" tooltip />
      <LabelValue label-class="text-right w-20 font-bold" value-class="font-bold" label="年龄" value="item.cwh" />
    </div>
    <div class="mt-2">
      <LabelValue label-class="text-right font-bold" value-class="font-bold ml-2" label="" value="布洛芬222 " />
    </div>
    <a-divider class="mb-2 mt-2" />
    <!-- :pagination="{ total: store.page.total, current: store.page.current, pageSize: store.page.pageSize }" -->
    <BaseTable fill column-code="000104" :loading="loading" :data-source="dataSource" @change="onPageChange">
      <template #bodyCell="{ column, record }">
        <template v-if="column.dataIndex === 'hszxzt'">
          <a-tag v-if="record.hszxzt == 1" color="green">已执行</a-tag>
          <a-tag v-else color="blue">未执行</a-tag>
        </template>
      </template>
    </BaseTable>
  </a-modal>
</template>
<script setup>
import { ref, watch } from 'vue'
// import { message } from 'ant-design-vue'
import LabelValue from '@/components/LabelValue'
// import useUserStore from '@/store/user'
// import { post } from '@/utils/request'

const props = defineProps({
  open: Boolean,
  currentBedNo: {
    type: String,
    default: null
  }
})
const dataSource = ref([])
// const searchKey = ref()
const loading = ref(false)

const emit = defineEmits(['update:open', 'close', 'success'])
const getData = async () => {
  loading.value = true
  loading.value = false
  // const { code, data } = await post('/inp/zydj/getInpRecordList', {
  //   djzt: 3, //住院状态 0：在院 1：出院 2：待出院 3：待入院
  //   pyjm: searchKey.value //拼音简码
  // })
  // loading.value = false
  // if (code === 0) {
  //   dataSource.value = data
  // }
}

watch(
  () => props.open,
  (value) => {
    if (value) {
      getData()
    }
  }
)

const onCancel = () => {
  emit('update:open', false)
  // emit('close')
}

const onOk = async () => {
  // try {
  //   await formRef.value.validateFields()
  //   const { code, msg } = await post('/inp/zyhs/doTransferInWard', {
  //     czr: empId //操作人
  //   })
  //   if (code !== 0) return message.error(msg || '操作失败')
  //   message.success(msg || '操作成功')
  //   emit('update:open', false)
  //   emit('success')
  // } catch (errorInfo) {
  //   message.error('请输入完整')
  // }
  emit('update:open', false)
  // emit('success')
}
</script>
<style lang="less" scoped></style>
